/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaPerfilPaciente.java
 *
 * Created on 04/12/2011, 14:48:13
 */

package br.uff.ihc.gui;

import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Toolkit;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Adrielle
 */
public class ResultadoConsultaConsultas extends javax.swing.JFrame {

    /** Creates new form TelaPerfilPaciente */
    public ResultadoConsultaConsultas(String nome) {
        initComponents();
        Insets in = Toolkit.getDefaultToolkit().getScreenInsets(this.getGraphicsConfiguration());
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        int width = d.width - (in.left + in.top);
        int height = d.height - (in.top + in.bottom);
        setSize(width, height);
        setLocation(in.left, in.top);
        setExtendedState(ResultadoConsultaConsultas.MAXIMIZED_BOTH);

        lbNomeUsuario.setText(nome);

//        try {
//            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (UnsupportedLookAndFeelException e) {
//        } catch (ClassNotFoundException e) {
//            // handle exception
//        } catch (InstantiationException e) {
//            // handle exception
//        } catch (IllegalAccessException e) {
//            // handle exception
//        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        lbRotuloUsuario = new javax.swing.JLabel();
        lbNomeUsuario = new javax.swing.JLabel();
        lbData = new javax.swing.JLabel();
        pnPrincipal = new javax.swing.JPanel();
        pnNovoPaciente = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbConsultas = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Resultado da Consulta de Consultas Agendadas");

        jPanel5.setBackground(new java.awt.Color(47, 120, 47));

        lbRotuloUsuario.setFont(new java.awt.Font("Lucida Sans Typewriter", 1, 13));
        lbRotuloUsuario.setForeground(new java.awt.Color(255, 255, 255));
        lbRotuloUsuario.setText("Usuário:");

        lbNomeUsuario.setFont(new java.awt.Font("Lucida Sans Typewriter", 0, 13));
        lbNomeUsuario.setForeground(new java.awt.Color(255, 255, 255));
        lbNomeUsuario.setText("João Victor");

        lbData.setFont(new java.awt.Font("Lucida Sans Typewriter", 0, 13));
        lbData.setForeground(new java.awt.Color(255, 255, 255));
        lbData.setText("Quarta, 7 de dezembro de 2011 10:30h");

        pnPrincipal.setBackground(new java.awt.Color(255, 255, 255));
        pnPrincipal.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnPrincipal.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnNovoPaciente.setBackground(new java.awt.Color(255, 255, 255));
        pnNovoPaciente.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 51, 0), 1, true));
        pnNovoPaciente.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        tbConsultas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"30/01/2012", "13:30", "Dra. Amanda "},
                {"15/02/2012", "13:30", "Dra. Amanda"},
                {"15/02/2012", "15:00", "Dr. Ronaldo"}
            },
            new String [] {
                "Data", "Hora", "Médico"
            }
        ));
        jScrollPane1.setViewportView(tbConsultas);

        pnNovoPaciente.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 40, 920, 360));

        jButton1.setFont(new java.awt.Font("DejaVu Sans", 0, 13)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/uff/ihc/gui/imagens/detalhes.png"))); // NOI18N
        jButton1.setText("Visualizar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        pnNovoPaciente.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(960, 410, 120, 40));

        pnPrincipal.add(pnNovoPaciente, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 20, 1180, 600));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbRotuloUsuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbNomeUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 609, Short.MAX_VALUE)
                .addComponent(lbData, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(pnPrincipal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1329, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(18, Short.MAX_VALUE)
                .addComponent(pnPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 649, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbRotuloUsuario)
                    .addComponent(lbNomeUsuario)
                    .addComponent(lbData))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        ConsultaDetalhes c= new ConsultaDetalhes();
        int i = tbConsultas.getSelectedRow();
       
        if (i==0){
            c.setValores(0, "30/01/2011", 0);
        }else if (i==1){
            c.setValores(0,"15/02/2012", 0);
        }else {
            c.setValores(6,"15/02/2012", 1);
        }


       c.setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ResultadoConsultaConsultas("").setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbData;
    private javax.swing.JLabel lbNomeUsuario;
    private javax.swing.JLabel lbRotuloUsuario;
    private javax.swing.JPanel pnNovoPaciente;
    private javax.swing.JPanel pnPrincipal;
    private javax.swing.JTable tbConsultas;
    // End of variables declaration//GEN-END:variables

}
